<?php

class skinModel extends Model{
    public function selectUser($paging,$pagesize){
        $sql = "select * from h_skin limit ".($paging-1)*$pagesize.",".$pagesize;
        return $this->link->selectByAll($sql);
    }
	public function countskin(){
        $sql = "select * from h_skin";
        return $this->link->count($sql);
    }
	public function deleteskin($skinid){
        $sql = "delete from h_skin where id=$skinid";
        return $this->link->delete($sql);
    }
	public function addskin($skin_id, $skin_skin,$skin_smskin,$skin_name, $skin_price){
        $sql = "INSERT INTO h_skin (hid,img,smimg,name,price) VALUES ('$skin_id','$skin_skin','$skin_smskin','$skin_name','$skin_price')";
        return $this->link->insert($sql);
    }
	public function modifyskinimgs($modify_id,$modify_skin,$modify_smskin,$modify_name,$modify_price,$skin_id){
        $sql = "UPDATE h_skin SET hid='$modify_id',img = '$modify_skin',smimg = '$modify_smskin',`name`='$modify_name',price='$modify_price' WHERE id ='$skin_id'";
        return $this->link->update($sql);
    }
	public function modifyskinimgone($modify_id,$modify_skin,$modify_name,$modify_price,$skin_id){
        $sql = "UPDATE h_skin SET hid='$modify_id',img = '$modify_skin',`name`='$modify_name',price='$modify_price' WHERE id ='$skin_id'";
        return $this->link->update($sql);
    }
    public function modifyskinimgtwo($modify_id,$modify_smskin,$modify_name,$modify_price,$skin_id){
        $sql = "UPDATE h_skin SET hid='$modify_id',smimg = '$modify_smskin',`name`='$modify_name',price='$modify_price' WHERE id ='$skin_id'";
        return $this->link->update($sql);
    }
	public function modifyskin($modify_id,$modify_name,$modify_price,$skin_id){
        $sql = "UPDATE h_skin SET hid='$modify_id',`name`='$modify_name',price='$modify_price' WHERE id ='$skin_id'";
        return $this->link->update($sql);
    }
}
?>